# -*- coding: utf-8 -*-
"""
-------------------------------------------------
Project Name: luffcity study project
File Name: 并发进程练习.py
Author: kij
Create Date: 2021/3/12
-------------------------------------------------
"""
import time, os, multiprocessing


def print_time():
	print(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()))


class MyProcess(multiprocessing.Process):

	def run(self):
		print(time.time(), self.name, os.getpid(), os.getppid())


if __name__ == '__main__':
	my1 = MyProcess()
	my1.start()

	my2 = MyProcess()
	my2.start()

	my3 = MyProcess()
	my3.start()

	my4 = MyProcess()
	my4.start()

	my5 = MyProcess()
	my5.start()

	my6 = MyProcess()
	my6.start()

	my7 = MyProcess()
	my7.start()

	my8 = MyProcess()
	my8.start()

	my1.join()
	my2.join()
	my3.join()
	my4.join()
	my5.join()
	my6.join()
	my7.join()
	my8.join()

	print(my8.is_alive())

	print('程序主进程===============',os.getpid(), os.getppid())
